#ifndef _EVENT_H_
#define _EVENT_H_

#include <memory>
#include <string>
#include <functional>

namespace SEngine
{

    enum EventType 
    {
        SE_QUIT,
        
        SE_MOUSE_PRESS,
        SE_MOUSE_RELEASE,
        SE_MOUSE_MOVE,
        SE_MOUSE_WHEEL,
        
        SE_KEYPRESS,
        SE_KEYRELEASE,
    };

    class IEvent
    {
    public:
        virtual ~IEvent() = default;
        virtual size_t Type() = 0;
        virtual std::string DebugName() = 0;
        void Solved() { m_isValid = false; }
        operator bool() { return m_isValid; }
    private:
        bool m_isValid = true;      
    };

    template<typename T>
    class Event : public IEvent
    {
    public:
        virtual ~Event() = default;
        size_t Type() override { return typeid(T).hash_code(); }
        virtual std::string DebugName() { return typeid(T).name(); }

    };

    class QuitEvent;
    class MousePressEvent;
    class MouseReleaseEvent;
    class MouseMoveEvent;
    class MouseWheelEvent;
    class KeyPressEvent;
    class KeyReleaseEvent;

    using EventPtr             = std::shared_ptr<IEvent>;
    using QuitEventPtr          = std::shared_ptr<QuitEvent>;
    using MousePressEventPtr    = std::shared_ptr<MousePressEvent>;
    using MouseReleaseEventPtr  = std::shared_ptr<MouseReleaseEvent>;
    using MouseMoveEventPtr     = std::shared_ptr<MouseMoveEvent>;
    using MouseWheelEventPtr    = std::shared_ptr<MouseWheelEvent>;
    using KeyPressEventPtr      = std::shared_ptr<KeyPressEvent>;
    using KeyReleaseEventPtr    = std::shared_ptr<KeyReleaseEvent>;


} // namespace SEngine


#endif